package zh.javadesign.抽象工厂.impl01.factory.impl;

import zh.javadesign.抽象工厂.impl01.factory.ICacheAdapter;
import zh.javadesign.抽象工厂.scene.matter.EGM;

import java.util.concurrent.TimeUnit;

public class EGMCacheAdapter implements ICacheAdapter {

	private EGM egm = new EGM();

	@Override
	public String get(String key) {
		return egm.gain(key);
	}

	@Override
	public void set(String key, String value) {
		egm.set(key, value);
	}

	@Override
	public void set(String key, String value, long timeout, TimeUnit timeUnit) {
		egm.setEx(key, value, timeout, timeUnit);
	}

	@Override
	public void del(String key) {
		egm.delete(key);
	}
}
